Skip to content

ARROW-626: [Python] Enable pyarrow.BufferReader to read from any Python object implementing the buffer/memoryview protocol - #384

Closed
jeffknupp wants to merge 1 commit into
apache:masterfrom
jeffknupp:master
Closed

jeffknupp wants to merge 1 commit into
apache:masterfrom
jeffknupp:master

Conversation

@jeffknupp

Copy link
Copy Markdown
Contributor

No description provided.

…on object implementing the buffer/memoryview protocol
Comment thread python/pyarrow/io.pyx
if view.ndim != 1 or view.itemsize != 1:
raise ValueError('Value must be one-dimensional and byte-sized to convert to Buffer: {0}'
.format(type(obj)))
buf.reset(new pyarrow.PyBytesBuffer(view.obj))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that view.obj is the base object here https://github.com/python/cpython/blob/6f0eb93183519024cb360162bdd81b9faec97ba6/Objects/memoryobject.c#L43 -- can you try using something other than a bytes object in your test case?

@wesm

wesm commented Mar 15, 2017

Copy link
Copy Markdown
Member

I'm 90% certain this patch is going to require changes in pyarrow/io.h/cc to be based on the buffer protocol instead of PyBytes

@jeffknupp

Copy link
Copy Markdown
Contributor Author

@wesm You're right, I read the memoryview docs backwards. It will definitely require a change in pyarrow/io.[cc|h]. I'm going to close this pull request as the proper change requires a good deal more work.

@jeffknupp jeffknupp closed this Mar 15, 2017
wesm added a commit to wesm/arrow that referenced this pull request Sep 8, 2018
This will enable most of the outstanding PRs to be rebased and then merged

Close apache#384
Close apache#394

Author: Wes McKinney <wes.mckinney@twosigma.com>

Closes apache#397 from wesm/PARQUET-1104 and squashes the following commits:

4106c5b [Wes McKinney] Include boost_system in static toolchain until ARROW-1536 resolved
005ee74 [Wes McKinney] Account for internal API change in ARROW-1511
3cab00d [Wes McKinney] Change MutableBuffer to Buffer to account for deprecation in ARROW-1402
7cd9702 [Wes McKinney] Upgrade to Apache Arrow 0.7.0 RC0

Change-Id: I6d0af9910da4d123ac66ec1a58a0de96c7ecaa95
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants